<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/pages/login/common.jsp"%>
<%
	String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="B2B电商平台" name="description" />
<meta content="B2B电商平台" name="keyword" />

<title>B2B电商平台.满减活动统计</title>
<link rel="icon" href="include/images/icss.ico" type="image/x-icon" />
<link rel="shortcut icon" href="include/images/icss.ico"
	type="image/x-icon" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/global.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/style.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/pro.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/proManage.css" />
<link rel="stylesheet"
	href="<%=path%>/include/JQuery ui/css/smoothness/jquery-ui-1.7.3.custom.css"
	type="text/css"></link>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/pagination/page.css" media="all">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/mmt_trading.css" />
<script type="text/javascript"
	src="<%=path%>/include/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path%>/include/js/cookies.js"></script>
<script type="text/javascript" src="<%=path%>/include/js/icss.busin.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/JQuery ui/js/jquery-ui-1.7.3.custom.min.js"></script>
<script type="text/javascript" src="<%=path%>/include/js/icss.common.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/pagination/jquery.pagination.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/pagination/init.js"></script>
<script src="<%=path%>/include/DatePicker/WdatePicker.js"
	charset="UTF-8" type="text/javascript"></script>

<style type="text/css">
td {
	font-size: 14px;
}

.noborder {
	border: none;
	height: 2px;
	overflow: hidden;
}

.noborder td {
	height: 2px;
}
#listTable th {
	line-height: 30px;
	border: 1px solid #ddd;
	font-weight: bold;
}
.search_lis_se input{
height: 24px;
}
#list_tbody td {
	border: 1px solid #ddd;
	padding: 0px 4px;
	line-height: 26px;
}
</style>
<script type="text/javascript">
	$(function(){
		_queryList();
	})
	
	var pagination;
	function _queryList(){
		var url = "<%=path%>/fullStatistics/queryReduceList.do";
		var data = {
			beginDate : $("#beginDate").val(),
			endDate : $("#endDate").val(),
			queryName : $("#queryName").val()
		};
		pagination = _initPagination({'pageId':'pagination', 'cKey':'queryReduceList','url': url,'data': data, 'rows': 8, 'callback':_initDataList});
	}
	function _initDataList(data) {
 		var d = data.rows;
 		var total = data.total;
		var re = new RegExp("\u0001"+"\+", "ig");
		var re1 = new RegExp("\u0002"+"\+", "ig");
		var str = "";
		if(d.length>0){
			for(var i=0;i<d.length;i++){
				str += '<tr class="list_table_tr">';
				str += '	<td class="span20" style="text-align:left;vertical-align: middle;" nowrap>' + d[i].REDUCE_NAME + '</td>';
				str += '	<td class="span30" style="text-align:center;vertical-align: middle;" nowrap>'+ d[i].BEG_TIME + '<br/>' + d[i].END_TIME + '</td>';
				str += '	<td class="span10" style="text-align:right;vertical-align: middle;" nowrap>' + d[i].USE_CONDITION + '</td>';
				str += '	<td class="span10" style="text-align:right;vertical-align: middle;" nowrap>' + d[i].COUPONS_PRICE + '</td>';
				str += '	<td class="span10" style="text-align:right;vertical-align: middle;" nowrap>' + d[i].USER_CT + '</td>';
				str += '	<td class="span10" style="text-align:center;vertical-align: middle;" nowrap>' + d[i].STATUS_NAME + '</td>';
				str += '	<td class="span15" nowrap style="text-align:center;vertical-align: middle;">';
				str += '	<a class="list_table_a" onclick="detail(\'' + d[i].REDUCE_ID + '\');" href="javascript:;">查看</a>';
				str += '	</td>';
				str += "</tr>";
			}
		} else {
			str +='<tr class="list_table_tr"><td class="span30" style="text-align:center;vertical-align: middle;" nowrap colspan="7">暂无数据</td></tr>';
		}
		$("#list_tbody").html(str);
		_reHeight();
	 }
	
	function detail(reduceId){
	 	document.location.href = "<%=path%>/fullStatistics/toOrderList.do?queryId="
				+ reduceId + "&type=reduce";
	}

	function _clear() {
		$("#beginDate").val('');
		$("#endDate").val('');
		$("#queryName").val('');
	}
</script>
</head>
<body style="font-family: '微软雅黑'">
	<div id="contentDiv" style="padding:4px; width:99%;">
		<div class="colnums-2-ab-b">
			<div class="toptil" >满减活动统计</div>
			<div class="search_lis"
				style="border: 1px solid #e0e0e0;background: #f5f5f5;padding-left:6px;margin-bottom:10px;font-size:14px;width: 99%;">
				<!--search_lis S-->
				<div class="search_lis_se" style="height:26px;margin-left: 4px;">
					<!--search_lis_se S-->
					<span >活动名称:</span> <input name="querytitle" id="queryTitle" type="text" class="in_bit" maxlength="40" style="width: 130px;" >
				<span style="margin-left: 4px;">活动时间:</span>
					<input type="text" class="Wdate" onfocus="WdatePicker({position:{left:297,top:88}})"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'endDate\')}'})"
						style="width: 100px;height: 24px;margin-bottom: 0px;cursor:pointer;"
						id="beginDate" readOnly name="beginDate"
						onkeydown="if(event.keyCode==13) return false;" />
					<span  style="margin-left: 5px;">至</span>
					<input
						type="text" class="Wdate" onfocus="WdatePicker({position:{left:429,top:88}})"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'beginDate\')}'})"
						style="width: 100px;height: 24px;margin-bottom: 0px;cursor:pointer;"
						id="endDate" readOnly name="endDate"
						onkeydown="if(event.keyCode==13) return false;"/>
					<button type="button" class="cxx_btn" onclick="_queryList()">查询</button>
					<button type="button" class="cxx_btn" onclick="_clear()">清空</button>
				</div>
			</div>
			<div class="row-fluid dataTables_wrapper" style="width:100%;">
				<table id="listTable"
					class="table table-hover table-nomargin table-bordered usertable dataTable"
					style="width: 100%; border-spacing: 0;">
					<thead>
						<tr class="trBgd"
							style="background-color: #eee;text-align: center; height: 31px; border: 1px solid #ddd; white-space: nowrap; background-position: 0 -123px; line-height: 30px; font-weight: bold;">
							<th class="t2"
								style="text-align:center;vertical-align: middle;">满减活动名称</th>
							<th class="t2"
								style="text-align:center;vertical-align: middle;">开始时间-结束时间</th>
							<th class="t2"
								style="text-align:center;vertical-align: middle;">使用条件（元）</th>
							<th class="t2"
								style="text-align:center;vertical-align: middle;">扣减金额（元）</th>
							<th class="t2"
								style="text-align:center;vertical-align: middle;">使用次数</th>
							<th class="t2"
								style="text-align:center;vertical-align: middle;">状态</th>
							<th class="t2"
								style="text-align:center;vertical-align: middle;">详情</th>
						</tr>
					</thead>
					<tbody id="list_tbody">
					</tbody>
				</table>
				<div id="pagination"></div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		_reHeight();
	});
	function _reHeight() {
		var main = $(window.parent.document).find("#rightFrame");
		var mainheight = $("#contentDiv").height();
		main.height(mainheight);
	}
</script>
</html>
